package com.csu.device.dao;

import com.csu.device.entity.Behavior;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface BehaviorDao {

    /**
     * 添加行为检测
     * @param behavior
     * @return
     */
    public Integer addBehavior(Behavior behavior);


    public List<Map<String,Object>> findAllBehaviorToView(Map<String,Object> map);

    public List<Behavior> findAllBehaviorByError(Map<String,Object> map);

    public List<Map<String,Object>> findAllBehaviorByScene(Map<String,Object> map);

    /**
     * 查看一周以内设备使用次数
     * @param map
     * @return
     */
    public List<Map<String,Object>> findAllBehaviorGroupByScene(Map<String,Object> map);

    /**
     * 查询所有异常信息
     * @param map
     * @return
     */
    public List<Map<String,Object>> findAllBehaviorByPage(Map<String,Object> map);



    public Integer findAllBehaviorByPageCount(Map<String,Object> map);
    /**
     * 处理消息
     * @param map
     * @return
     */
    public int updateBehaviorByMessage(Map<String,Object> map);

    /**
     * 查询老人绑定的设备号
     * @param map
     * @return
     */
    public List<Map<String,Object>> findDeviceSnByUserIdOrTypeId(Map<String,Object> map);

    /**
     * 根据老人id查询异常信息
     * @param
     * @return
     */
    List<Map<String,Object>> getOlderErrorByOlderId(List<String> list);

    /**
     * 根据场景id -》 房间id查询异常信息
     * @param
     * @return
     */
    List<Map<String,Object>> findErrorByFamilyId(List<String> list);
}
